package com.itlong.cloud.project.property;

import com.itlong.cloud.POJO.DTO.property.PropertyCarGetOneDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyCarGetPageDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyCarSaveDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyCarUpdateDTO;
import com.itlong.cloud.POJO.VO.property.PropertyCarGetOneVO;
import com.itlong.cloud.POJO.VO.property.PropertyCarGetPageVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      物业管理-车辆管理暴露接口
 * </desc>
 *
 * @createDate 2018/08/17
 */
@FeignClient(name = "project-service")
public interface IPropertyCarServiceClient {

    /**
     * <desc>
     *      获取单个车辆信息
     * </desc>
     *
     * @param propertyCarGetOneDTO 获取单个车辆信息查询参数DTO
     * @return 单个车辆信息
     * @author wangzhi
     * @createDate 2018/08/22
     */
    @PostMapping(path = "property/car/getOneCar")
    PropertyCarGetOneVO getOneCar(@RequestBody PropertyCarGetOneDTO propertyCarGetOneDTO) throws Exception;

    /**
     * <desc>
     *      分页获取车辆信息
     * </desc>
     *
     * @param propertyCarGetPageDTO 查询参数
     * @return 分页结果
     * @author wangzhi
     * @createDate 2018/08/22
     */
    @PostMapping(path = "property/car/getCarsByPage")
    Page<PropertyCarGetPageVO> getCarsByPage(@RequestBody PropertyCarGetPageDTO propertyCarGetPageDTO) throws Exception;

    /**
     * <desc>
     *      添加车辆信息
     * </desc>
     *
     * @param propertyCarSaveDTO 添加参数
     * @return 受影响的行数
     * @author wangzhi
     * @createDate 2018/08/22
     */
    @PostMapping(path = "property/car/saveCar")
    Integer saveCar(@RequestBody PropertyCarSaveDTO propertyCarSaveDTO) throws Exception;

    /**
     * <desc>
     *      删除车辆，含批量删除
     * </desc>
     *
     * @param carIds 车辆id，多个用英文","相连
     * @return 受影响的行数
     * @author wangzhi
     * @createDate 2018/08/23
     */
    @PostMapping(path = "property/car/deleteCars")
    Integer deleteCars(@RequestParam("carIds") String carIds) throws Exception;

    /**
     * <desc>
     *      修改车辆
     * </desc>
     *
     * @param propertyCarUpdateDTO 修改参数DTO
     * @return 受影响的行数
     * @author wangzhi
     * @createDate 2018/08/23
     */
    @PostMapping(path = "property/car/updateCar")
    Integer updateCar(@RequestBody PropertyCarUpdateDTO propertyCarUpdateDTO) throws Exception;

    /**
     * <desc>
     *      查询所有车辆
     * </desc>
     *
     * @param propertyCarGetPageDTO 查询参数
     * @return 车辆集合
     * @author wangzhi
     * @createDate 2018/08/23
     */
    @PostMapping(path = "property/car/getAllCars")
    List<PropertyCarGetPageVO> getAllCars(@RequestBody PropertyCarGetPageDTO propertyCarGetPageDTO) throws Exception;

    /**
     * <desc>
     *      批量保存车辆信息
     * </desc>
     *
     * @param propertyCarSaveDTOList 车辆信息集合
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2018/08/23
     */
    @PostMapping(path = "property/car/batchSaveCars")
    Integer batchSaveCars(@RequestBody List<PropertyCarSaveDTO> propertyCarSaveDTOList) throws Exception;

    /**
     * <desc>
     *      查询所有车牌号
     * </desc>
     *
     * @param projectId 项目编号
     * @return 项目下所有车牌号
     * @author wangzhi
     * @createDate 2019/01/07
     */
    @PostMapping(path = "property/car/getAllPlateNumberByProjectId")
    List<String> getAllPlateNumberByProjectId(@RequestParam("projectId") String projectId) throws Exception;
}
